1. Field of the Invention
The present invention relates to a RAID controller and access methods thereof, especially a RAID—5 controller and access methods thereof with data stream distribution and aggregation operations based on the primitive data access block of storage devices.
2. Description of the Prior Art
Along with the increasing data amount for processing and the trend of data digitalization, how to build a storage system with high availability, high performance, and high volume is one of the most important topics nowadays. In present computer systems, RAID (Redundant Array of Independent Disks) systems are one of the storage systems most commonly used, capable of offering the host entity storage space of high availability, high performance, and high volume.
Categorized by the operating modes, the RAID level can be divided into level 0, 1, 2, 3, 4, 5, or 6. For a less complicated system, RAID level 0 and 1 are mainly used. However, RAID—0 system does not have the ability of fault tolerance, and stores data separately among the disk array; if there is any one hard disk broken, the stored data will loss accordingly. RAID—1 system stores data in two hard disks simultaneously, in other words, if there is one hard disk broken, the data can be retrieved from the other hard disk, and after the broken one is replaced by a new hard disk, the new hard disk can backup the data from the other hard disk. Although RAID—1 system affords a mechanism for data protection, the availability rate of the storage space in the RAID—1 system is only 50%.
Generally speaking, the RAID—5 system has both advantages of data protection and high availability rate of the storage space. Similar to the RAID—4 system utilizing an additional parity disk to store parity related information, the RAID—5 system stores parity information separately in different hard disks of the disk array instead of utilizing an additional parity disk.
Please refer to FIG. 1. FIG. 1 is a functional block diagram of a RAID—5 system 100 according to the prior art. The RAID—5 system 100 includes a RAID—5 controller 110 coupled to a host 101, a disk array 170 coupled to the RAID—5 controller 110. The disk array 170 includes a plurality of hard disks 181, 182, 183, 184, and 185, the RAID—5 controller 110 includes a CPU 130, a memory 120 coupled to the CPU 130, and a data access controller 140 coupled to both the memory 120 and the CPU 130. The RAID system 100 has to go through a RAID creation process to define the disk array 170 first, which is then represented to the host 101. After that, the disk array 170 becomes available to the host 101, and the host 101 can access the data in the disk array 170.
During the access operation of the RAID—5 system 100 of the prior art, when there are the data to be written in, the data should be stored in the memory 120 first, and wait for the analysis of the stages of the storage region intended to be written in performed by the CPU 130 so as to execute the reading process to the corresponding data. Afterwards, the CPU 130 executes the exclusive OR (XOR) operation to generate the parity data according to the data intended to be written in coordination with the read-out data, then stores the data intended to be written in and the parity data separately into different hard disks of the disk array. However, if there is an invalid hard disk, and the data of the invalid hard disk are included in the data needed for the parity data operation, the data of the invalid hard disk should be recovered first.
When reading data, the data transmitted from each hard disk is stored into the memory 120, and if there is no invalid hard disk, the CPU 130 will execute a discarding process on the parity data, and combine all the wanted data to generate the output data; if there is an invalid hard disk, the CPU 130 executes a recovering process on the corresponding data of the invalid hard disk, that is the CPU 130 executes the discarding process on the parity data and combines all the wanted data to generate the output data after executing the XOR operation on the data of the other hard disks to recover the data of the invalid hard disk.
Since so far, most RAID—5 systems are structured in a computer structure, or structured through I/O processors, it is the so-called “a software disk array”. However, due to the limitation of the structure, the unit of the data sub-streams is ranged from 4 KB to 256 KB, or more, in order to enhance the efficiency of the RAID—5 system, resulting in a very complicated determination and operation procedure while executing the access operation on the boundaries of the storage region intended to be processed.